const axios = require("axios");
const getCommentList = async (pageNum) => {
    if (pageNum < 1) {
        pageNum = 1;
    }
    const apiUrl = `https://api.bilibili.com/x/v2/reply?&oid=562045620&nohot=1&type=1&pn=${pageNum}`;
    const res = await axios.get(apiUrl);
    if (res?.data?.data) {
        const data = res.data.data;
        const {replies, page} = data;
        return {
            dataList: replies,
            totle: page.count,
        }
    } else {
        return null;
    }
}

module.exports = {
    getCommentList
}
